#702 Enhance branch layout for SHMetro 2020 style#775
Open
Unnamed2964 wants to merge 4 commits intorailmapgen:mainfrom
Open
#702 Enhance branch layout for SHMetro 2020 style#775Unnamed2964 wants to merge 4 commits intorailmapgen:mainfrom
Unnamed2964 wants to merge 4 commits intorailmapgen:mainfrom
Conversation
Author
|
疏忽大意了...我发现支线朝右的情况有问题,需要修复一下 |
Author
Author
|
由于修改了数据格式(添加了两个字段),所以可能需要算作一个新的版本号 |
Member
|
抱歉我还需要一些时间才能来审阅这一和并请求 :( |
Author
|
理解的 |
de239f9 to
bb2f1b6
Compare
Author
- getStnState: promote parallel branch stations to state=1 when their forward junction is ahead of current station - drawLine: guard against empty linePassStns array - _linePath: gate main-path terminal caps on stnStates===1 to prevent coloring caps at current station - _linePath: unify bifurcate section (remove redundant direction branches) - coline-shmetro: fix _linePath call signature after stnStates param insert - Add unit tests for getStnState and drawLine
5136faa to
d59dd4f
Compare
Author
|
混进去了一些和本pr无关的提交,rebase分开了 |
2e50cbb to
7673099
Compare
Author
Author
Comment on lines
+286
to
+310
| /** | ||
| * SHMetro 2020 style branch layout control. | ||
| */ | ||
| shmetro2020_info: { | ||
| /** | ||
| * Factor for the horizontal distance from bifurcation point to first branch station. | ||
| * Default is 1, meaning normal spacing. | ||
| */ | ||
| branch_distance_factor: number; | ||
| /** | ||
| * Horizontal offset from bifurcation point where the vertical turn begins. | ||
| * Default is 0, meaning turn starts at bifurcation point. | ||
| */ | ||
| branch_first_station_offset: number; | ||
| /** | ||
| * Type of bend at bifurcation: 'rightangle' (90°) or '45degree' (45°). | ||
| * Default is 'rightangle'. | ||
| */ | ||
| branch_bend_type: 'rightangle' | '45degree'; | ||
| /** | ||
| * Whether to align shorter branch endpoints to match the longer parallel branch. | ||
| * Default is false. | ||
| */ | ||
| branch_align_endpoints: boolean; | ||
| }; |
Member
There was a problem hiding this comment.
通常来说我们希望所有的属性都是通用的,虽然可能现在非2020及其他风格不会用到对应的数据,但正像我们在loop中实现的那样(比如bank),尽可能地通用这些属性值和名,以便后续使用
另外它也应该和branchSpacingPct一起被整合在branch键下
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.







Partly resolve #702.
本 PR 对上海地铁 2020 样式(sh2020)的分支线绘制逻辑进行了优化,新增两个可调参数:
此外还将方向箭头改为空心样式,在共线模式下使用黑色描边。
其他说明
本功能代码主要由 Claude Opus 4.5 辅助生成。
代码有经过人工审查。
如下图所示(本人拍摄),虽然 2020 版线路图处理分岔的一种情况是 #702 中所示的,但也的确存在从分岔点开始立刻分岔的画法,所以应该给予用户可调节参数。
